require(['./config'],()=>{
    require(['jquery','jquerycookie'],()=>{
        class Login{
            constructor(){
                this.matching()
            }
            matching(){
                $('.enter .button').click(()=>{
                    //获取账号，密码
                    let user = $('.enter .user').val()
                    let password = $('.enter .password').val()
                    let cookieUser = $.cookie(user)
                    // if(user=''){
                    //     $('.enter .user').val('输入不能为空')
                    //     $('.enter .user').css({
                    //         color:'red'
                    //     })
                    // }
                    $.cookie('随便',user,{expires:7,path:'/'});
                    if(cookieUser === password){
                        window.location.href = "/index.html";
                    }else{
                        $('.error').css({
                            display:'block'
                        })
                    }
                })
            }
        }
        return new Login()
    })
})